from Base import message, intersect, SS_VALID
from DRG import MDCF_DRG

def group(record):
  adrg_zd = []
  adrg_zd1 = []
  adrg_ss = ["35.4101","35.3100x001","35.3400x001","35.3400x003","35.3400x004","35.3400x006","35.4100x001","35.4100x002","35.4200x002","35.4200x005","35.4200x006","35.4200x007","35.4200x008","35.4201","35.5000","35.5100x001","35.5100x002","35.5100x003","35.5100x004","35.5100x005","35.5101","35.5300x001","35.5300x003","35.5301","35.6000","35.6100x001","35.6101","35.6102","35.6201","35.7000","35.7100x002","35.7100x003","35.7100x004","35.7100x005","35.7100x007","35.7100x008","35.7100x009","35.7100x010","35.7101","35.7200x001","35.7201","35.8100x005","35.8100x006","35.8200x006","35.8200x008","35.8200x010","35.8305","37.3300x006","37.3300x009","37.3300x012","37.3300x013","37.3300x015","37.3300x022","37.3300x023","37.3300x027","37.3300x028","37.3304","37.3307","37.3600x001","37.3600x005","37.3600x006","37.3600x008","38.8500x001","38.8500x012","38.8505","39.2100x001","39.2101"]
  adrg_ss1 = []
  dept_list = []

  if True and record.ssList and record.ssList[0] in adrg_ss:
    message('符合FD2入组条件，匹配规则：主手术匹配')

    if MDCF_DRG.FD23_group(record):
      return 'FD23'

    if MDCF_DRG.FD25_group(record):
      return 'FD25'
        
    return 'FD2'
  else:
    return ''
    
